﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class JobSeeker_ApplyOnline : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void btnApply_Click(object sender, EventArgs e)
    {
         string userName = txtEmail.Text.Trim();
        try
        {
            if (System.Web.Security.Membership.ValidateUser(userName, txtPassword.Text))
            {
                MembershipUser userInfo = System.Web.Security.Membership.GetUser(userName);
                if (userInfo != null)
                {
                     Session["usrInfo"] = userInfo;
                    
                    Response.Redirect("ApplyOnlineStep2.aspx");
                }
                else
                {
                    lblMsg.Text = "Login problem. Please try again";
                    lblMsg.ForeColor = System.Drawing.Color.Red;
                }
            }
            else
            {
                lblMsg.Text = "Login problem. Please try again";
                lblMsg.ForeColor = System.Drawing.Color.Red;
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
}